package day10;

import java.util.Calendar;
import java.util.Scanner;

public class Express {
    private int count = 0;
    Calendar cl = Calendar.getInstance();


//判断天数
    public int day(int d){
        View v = new View();
        int a = v.year();
        int b = v.month();
            if (b == 2) {
                if (run(a)) {
                    d = 29;
                } else {
                    d = 28;
                }
            } else if (b == 1 || b == 3 || b == 5 || b == 7 || b == 8 || b == 10 || b == 12) {
                d = 31;
            } else {
                d = 30;
            }
        return d;
        }

    //判断是否是闰年
    public  boolean run(int y){
        if(y%100 == 0){
            if(y%400 == 0){
                return true;
            }
        }else{
            if(y%4 == 0){
                return true;
            }
        }
        return false;
    }

    //计算休息日

    public void restDay(){
        int MAX_REST_DAY = 1000;
        Calendar cl = Calendar.getInstance();
        for (int i = 0; i < MAX_REST_DAY; i++) {
            String y = String.valueOf(cl.get(Calendar.YEAR));
            String m = String.valueOf(cl.get(Calendar.MONTH) + 1);
            String d = String.valueOf(cl.get(Calendar.DATE));
            if(cl.get(Calendar.MONTH) +1 < 10){
                System.out.println();
            }
        }

    }
}
